﻿using MapGeneration.Distributors;

namespace CustomItem
{
    public static class CustomItemExtensions
    {
        public static Structure GetStructureType(this Locker locker)
        {
            Structure result;
            string name = locker.name;
            switch (locker.StructureType)
            {
                case StructureType.LargeGunLocker:
                    {
                        if (name.StartsWith("LargeGun"))
                            result = Structure.LargeGun;
                        else if (name.StartsWith("RifleRack"))
                            result = Structure.RifleRack;
                        else
                            result = Structure.Unknown;
                    }
                    break;

                case StructureType.Scp079Generator:
                case StructureType.Workstation:
                    result = Structure.Unknown;
                    break;

                case StructureType.ScpPedestal:
                    result = Structure.ScpPeddestalLocker;
                    break;

                case StructureType.StandardLocker:
                    result = Structure.MiscLocker;
                    break;

                case StructureType.SmallWallCabinet:
                    if (name.StartsWith("RegularMedkit"))
                        result = Structure.MedkitCabinet;
                    else if (name.StartsWith("AdrenalineMedkit"))
                        result = Structure.AdrenalineCabient;
                    else
                        result = Structure.Unknown;
                    break;

                default:
                    result = Structure.Unknown;
                    break;
            }
            return result;
        }
    }
}